package top.letscode.adclicker.ad;

import org.openqa.selenium.WebDriver;

public abstract class AbstractUnion {

  protected void sleep(long millis) {
    try {
      Thread.sleep(millis);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }

  /**
   * 打开指定网址
   */
  public void open(WebDriver webDriver, String url) {
    webDriver.get(url);
    sleep(1000);
  }

  /**
   * 点击广告
   */
  public abstract void click(WebDriver webDriver);

  /**
   * 点击概率，小于1
   */
  public abstract float getRate();
}
